using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_UIPalette_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.UIPalette);
            args = new Type[]{typeof(huqiang.Data.FakeStruct), typeof(huqiang.Core.HGUI.UIElement), typeof(huqiang.Core.HGUI.UIInitializer)};
            method = type.GetMethod("Initial", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Initial_0);

            field = type.GetField("SelectColor", flag);
            app.RegisterCLRFieldGetter(field, get_SelectColor_0);
            app.RegisterCLRFieldSetter(field, set_SelectColor_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_SelectColor_0, AssignFromStack_SelectColor_0);
            field = type.GetField("ColorChanged", flag);
            app.RegisterCLRFieldGetter(field, get_ColorChanged_1);
            app.RegisterCLRFieldSetter(field, set_ColorChanged_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_ColorChanged_1, AssignFromStack_ColorChanged_1);
            field = type.GetField("TemplateChanged", flag);
            app.RegisterCLRFieldGetter(field, get_TemplateChanged_2);
            app.RegisterCLRFieldSetter(field, set_TemplateChanged_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_TemplateChanged_2, AssignFromStack_TemplateChanged_2);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.UIPalette());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.UIPalette[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* Initial_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Core.HGUI.UIInitializer @initializer = (huqiang.Core.HGUI.UIInitializer)typeof(huqiang.Core.HGUI.UIInitializer).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Core.HGUI.UIElement @element = (huqiang.Core.HGUI.UIElement)typeof(huqiang.Core.HGUI.UIElement).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Data.FakeStruct @fake = (huqiang.Data.FakeStruct)typeof(huqiang.Data.FakeStruct).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.UIComposite.UIPalette instance_of_this_method = (huqiang.UIComposite.UIPalette)typeof(huqiang.UIComposite.UIPalette).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Initial(@fake, @element, @initializer);

            return __ret;
        }


        static object get_SelectColor_0(ref object o)
        {
            return ((huqiang.UIComposite.UIPalette)o).SelectColor;
        }

        static StackObject* CopyToStack_SelectColor_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.UIPalette)o).SelectColor;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_SelectColor_0(ref object o, object v)
        {
            ((huqiang.UIComposite.UIPalette)o).SelectColor = (UnityEngine.Color)v;
        }

        static StackObject* AssignFromStack_SelectColor_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Color @SelectColor = (UnityEngine.Color)typeof(UnityEngine.Color).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            ((huqiang.UIComposite.UIPalette)o).SelectColor = @SelectColor;
            return ptr_of_this_method;
        }

        static object get_ColorChanged_1(ref object o)
        {
            return ((huqiang.UIComposite.UIPalette)o).ColorChanged;
        }

        static StackObject* CopyToStack_ColorChanged_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.UIPalette)o).ColorChanged;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_ColorChanged_1(ref object o, object v)
        {
            ((huqiang.UIComposite.UIPalette)o).ColorChanged = (System.Action<huqiang.UIComposite.UIPalette>)v;
        }

        static StackObject* AssignFromStack_ColorChanged_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.UIComposite.UIPalette> @ColorChanged = (System.Action<huqiang.UIComposite.UIPalette>)typeof(System.Action<huqiang.UIComposite.UIPalette>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.UIComposite.UIPalette)o).ColorChanged = @ColorChanged;
            return ptr_of_this_method;
        }

        static object get_TemplateChanged_2(ref object o)
        {
            return ((huqiang.UIComposite.UIPalette)o).TemplateChanged;
        }

        static StackObject* CopyToStack_TemplateChanged_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.UIPalette)o).TemplateChanged;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_TemplateChanged_2(ref object o, object v)
        {
            ((huqiang.UIComposite.UIPalette)o).TemplateChanged = (System.Action<huqiang.UIComposite.UIPalette>)v;
        }

        static StackObject* AssignFromStack_TemplateChanged_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.UIComposite.UIPalette> @TemplateChanged = (System.Action<huqiang.UIComposite.UIPalette>)typeof(System.Action<huqiang.UIComposite.UIPalette>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.UIComposite.UIPalette)o).TemplateChanged = @TemplateChanged;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.UIPalette();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
